using System;
using System.Collections.Generic;
using System.Text;

namespace GuavaData
{
    public class AddColumn : Operator
    {
        // DDL statement to add a column to a table

        #region Fields
        string table;
        public string Table
        {
            get { return table; }
            set { table = value; }
        }

        string column;
        public string Column
        {
            get { return column; }
            set { column = value; }
        }

        Domain.Domain domain;
        public Domain.Domain Domain
        {
            get { return domain; }
            set { domain = value; }
        }
        #endregion Fields

        public AddColumn(string table, string column, Domain.Domain domain)
        {
            this.table = table;
            this.column = column;
            this.domain = domain;
            this.parent = null;
        }

        public override void NotifyChange(Operator old, Operator newOp)
        {
            throw new Exception("The method or operation is not implemented.");
        }
        public override bool isQuery
        {
            get
            {
                return false;
            }
        }
        public override SqlText Visit(Provider qv)
        {
            return qv.Transform(this);
        }
        public override void Visit(Transform t, Command c)
        {
            t.Expand(this, c);
        }

        public override Operator Clone()
        {
            return new AddColumn(this.table, this.column, this.domain);
        }


        public override void Visit(Channel c, string table)
        {
            c.MapAliases(this, table);
        }

    }
}
